<template>
	<view style="background-color: #FFFFFF;height: 100vh;">
		<view class="content">
			<view style="display: flex;flex-direction: row;font-size: 18px;align-items: center;margin-left: 10%;">
				零钱额度:<input type="number" value="" v-model="money" placeholder="请输入增加的额度"  style="font-size: 18px;" />
			</view>
			 <view class="content" @click="useOutClickSide" style="display: flex;flex-direction: row;font-size: 18px;align-items: center;margin-left: 10%;">
			        请选择提交方式:<easyselect ref="easySelect" size="medium" :value="selecValue" @selectOne="selectOne" style="width: 100px;"></easyselect>
			    </view>
		</view>
		<view style="display: flex;justify-content: space-around;align-items: center;margin-top: 50px;flex-direction: column;" v-if="selecValue!=''">
			<view style="display: flex;flex-direction: column;align-items: center;" v-if="selecValue==1">
			
					<image src="/static/zhifubao.png" mode="" style="width: 200px;height: 200px;"></image>
					<text>微信</text>
			</view>
			<view style="display: flex;flex-direction: column;align-items: center;" v-if="selecValue==2">
				
				<image src="/static/zhifubao.png" mode="" style="width: 200px;height: 200px;"></image>
				<text>支付宝</text>
			</view>
		</view>
		<view style="margin-left: 5%;">
			注:<br><br>付款时备注快狗账号方便及时查询增加额度。<br>预期一小时到账，如未到账请重新提交。
		</view>
		<view class="tijiao" @click="toback">
			提交
		</view>
	</view>
</template>

<script>
	import easyselect from '@/components/easy-select/easy-select.vue';
	export default {
		components:{
			easyselect
		},
		data() {
			return {
				feedbacks:'',
				 selecValue: '',
				 money:''
			}
		},
		onNavigationBarButtonTap(e) {
			if(e.float=='right'){
				uni.navigateTo({
					url:'/pages/help/jilu'
				})
			}
		},
		methods: {
			 selectOne(options) {
			            this.selecValue = options.value
						console.log(options)
			        },
			        useOutClickSide() {
			            this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions()
			        },
			goback(){
				uni.navigateBack({
					delta:1
				})
			},
			toback(){
				let token = uni.getStorageSync("token")
				uni.request({
					url: this.G_base + '/api/lz/etcAdd',
					data:{
						money:this.money,
						pay_type:this.selecValue,
					},	
					method: "POST",
					header: {
						'content-type': 'application/x-www-form-urlencoded',
						'Authori-zation': 'Bearer ' + token
					},
					success: (res) => {
						console.log(res);
						if (res.data.status == 200) {
							uni.showToast({
								title: '提交申请成功',
								icon:'none'
							})
							
							this.money=''
							this.selecValue=''
							setTimeout(()=>{
								uni.navigateTo({
									url:'/pages/help/jilu'
								})
							},1000)
						} else {
							uni.showToast({
								title: res.data.msg,
								icon:'none'
							})
						}
					},
					fail: (err) => {
						console.log(err)
					}
				});
			}
		}
	}
</script>

<style scoped>
.content{
	
}
.input{
	background-color: #fafafa;
	border-radius: 40px;
	width: 90%;
	margin: 0 auto;
	margin-top: 20px;
}
.beizhu{
	background-color: #fafafa;
	border-radius: 10px;
	width: 90%;
	margin: 0 auto;
	margin-top: 10px;
}
.tijiao{
	width: 164px;
	height: 50px;
	margin: 150upx auto;
	background: -webkit-linear-gradient(left, #a00000, #e10004, #a00000);
	border-radius: 40px;
	display: flex;
	justify-content: center;
	align-items: center;
	color: #FFFFFF;
}
</style>
